-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify and improve docker setup. #215
Conversation
|
94b99fa
to
9c15084
Compare
We'll use this from our Dockerfile to ensure our local gems get used.
These files aren't "primary" enough to put at the repository root. With these changes, the docker command is now: ``` $ docker compose -f config/docker_demo/docker-compose.yaml up --build elasticgraph ```
- Don't `bundle install` or pull in the Ruby base image multiple times. - Instead of copying over the entire project, just copy over the parts that we need. This should make building the `elasticgraph` docker image faster. - Provide a strong guarantee that no released ElasticGraph gems are being used, as we only want our local ElasticGraph gems to get built into the docker image. - Use `ELASTICGRAPH_GEMS_PATH` env var instead of a `sed` command. The `sed` command is a bit harder to maintain, IMO, and could be brittle--the replaced code snippet may change in the future. - Remove OpenSearch Dashboards. While they are often useful to include, we want to keep our demo setup as slimmed down as possible, and minimize the likelihood that users will run out of docker resources. - Honor the `OPENSEARCH_VERSION` ENV var rather than hardcoding it to 2.18.0.
9c15084
to
94acf14
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the nested directory makes sense as it's a docker file that launches the test app not a dockerfile for the library as I was initially thinking when I started. I think ideally bundle install can run before copying over the rest of the files, and I think a blacklist makes more sense than a whitelist of directories but this is a good improvement from what I had.
As @jwils pointed out, it's beneficial to run the `bundle install` as early as possible, because we want expensive steps that change less frequently (e.g. gem downloads) to run earlier.
Allow CLI ElasticGraph gem source to be overriden via ENV var.
We'll use this from our Dockerfile to ensure our local gems get used.
Move docker files to
config/docker_demo
.These files aren't "primary" enough to put at the repository root.
With these changes, the docker command is now:
Simplify and improve docker setup.
bundle install
or pull in the Ruby base image multiple times.This should make building the
elasticgraph
docker image faster.we only want our local ElasticGraph gems to get built into the docker image.
ELASTICGRAPH_GEMS_PATH
env var instead of ased
command. Thesed
command is a bit harder to maintain, IMO, and could be brittle--the replaced
code snippet may change in the future.
to keep our demo setup as slimmed down as possible, and minimize the likelihood
that users will run out of docker resources.
OPENSEARCH_VERSION
ENV var rather than hardcoding it to 2.18.0.